//
//  MYXmymoneyViewModel.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/12/1.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYXmymoneyViewModel.h"
#import "MYXmymoneyModel.h"
#import "MYXMemberMdel.h"


@implementation MYXmymoneyViewModel
- (void)loadmymoney :(mymoneyBlock)result{
    [[MYXHttpManager shared] mymoney:^(BOOL success, NSString *msg, id object) {
        if (success) {
            self.viewModel =object;
            MYXMemberMdel *model = [MYXMemberMdel sharedInstance];
            model.userinfo.user_money = self.viewModel.money;
            model.userinfo.ticketcount = self.viewModel.ticketcount;
            [model save];
            
           result(YES);
        }else{
            result(NO);
        }
        
    } errorResult:^(NSError *enginerError) {
        result(NO);
    }];
}
@end
